﻿using System;
using System.Text;
using Baik.Interface.Execution;
using Baik.Interface.Framework;

namespace Baik.Execution
{
    public class ExecutionRegistrationScript: IRegistrationScript
    {
        public void Register(IInjector injector)
        {
            injector.Register<IObject>().As <Baik.Execution.Object>();
            injector.Register<IString>().As<Baik.Execution.String>();
            injector.Register<INumber>().As<Baik.Execution.Number>();
            injector.Register<IFunction>().As<Baik.Execution.Function>();
            injector.Register<IBoolean>().As<Baik.Execution.Boolean>();
            injector.Register<ITrue>().AsSingletonOf<Baik.Execution.TrueValue>();
            injector.Register<IFalse>().AsSingletonOf<Baik.Execution.FalseValue>();
            injector.Register<IScope>().As<Baik.Execution.Scope>();
            injector.Register<IUndefined>().AsSingletonOf<Undefined>();
            injector.Register<IExecutionEnvironment>().AsSingletonOf<ExecEnvironment>();
            injector.Register<IArray>().As < Baik.Execution.Array>();
            injector.Register<IExceptionHost>().As<LanguageException>();
            injector.Register<ISystem>().AsSingletonOf<SystemObject>();
            injector.Register<IExceptionThrower>().AsSingletonOf<ExceptionThrower>();
            injector.Register<IBuiltInFunction>().As<BuiltInFunction>();
        }
    }
}
